package vip.web3.api.dao.biz;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import vip.web3.api.entity.biz.RecordEntity;

import java.math.BigDecimal;
import java.util.List;

/**
 * 分红明细Mapper接口
 * <p>
 * aut-horlilei
 *
 * @date 2024-09-27
 */
@Mapper
public interface RecordDao extends BaseMapper<RecordEntity> {

    @Select("select sum(amount) from a_record where user_id = #{userId} and type in (6,7,8,9)")
    BigDecimal todayBrokerages(Integer userId);

    List<RecordEntity> flowRecords(Integer userId, List<Integer> types);

    @Select("select sum(amount) from a_record  where type=1")
    Double recordSum();
}
